home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 5768 < prev    next >
Encoding:
Text File  |  1996-08-05  |  839 b   |  25 lines

  1. Path: airdmhor.gen.nz!not-for-mail
  2. From: gumboot@airdmhor.gen.nz (Simon Hosie)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Easiest way to center a string?
  5. Date: 20 Feb 1996 18:37:28 +1300
  6. Organization: Airdmhor : a couple of BBS's, a bunch of people, and a cat.
  7. Message-ID: <4gbmmo$m5v@airdmhor.gen.nz>
  8. References: <4fobka$1st@parlor.hiwaay.net> <DMqEG5.8z4@eskimo.com> <4frif5$e6p@fohnix.metronet.com> <DMuuzG.1yK@eskimo.com>
  9. NNTP-Posting-Host: airdmhor.gen.nz
  10. X-Newsreader: TIN [version 1.2 PL2]
  11.  
  12. Whoever:
  13. > <whatever>
  14.  
  15. mAg:
  16. > Have you found a better way using the man page on printf(). I would appreciate if you could 
  17. > share it with the rest of the newsgroup.
  18.  
  19.   Is this portable (I don't have my man pages available, I broke them)..
  20.  
  21. #define LineLen 80
  22. char *String = "I am a fish";
  23.  
  24. printf("%*s\n", (strlen(String - LineLen) / 2, String);
  25.